function ticker(tick,frequency)
% ticker plots a dot at specified frequency. 
% Every 10 ticks it'll put a number
% Every 100 ticks it'll move to the next line.
%
%LICENSE: BSD
%Author: Alexander Sorokin,syrnick@gmail.com


if nargin<1
    fprintf('\n')
    return
end
if nargin<2
    frequency=10;
end

if mod(tick,frequency)==0
    if mod(tick,frequency*10*10)==0
        fprintf('O\n %d',tick)
    elseif mod(tick,frequency*10)==0        
        fprintf('%01d',mod(tick/frequency/10,10));
    else
        fprintf('.');drawnow
    end    
end
